typedef unsigned long u32;
// 常用颜色定义
#define BLUE    0x0000FF
#define RED     0xFF0000
#define GREEN   0x00FF00
#define WHITE   0xFFFFFF
#define BLACK   0x000000
void lcd_init();
void lcd_draw_background(u32);         // 如果没有加这一行，背景色是花花绿绿的
void lcd_draw_hline(int,int,int,u32);
void lcd_draw_vline(int,int,int,u32);
void draw_ascii_ok(int,int,u32,char*);
void draw_circular(int,int,int,u32);
void delay(int);
void main(void)
{
    lcd_init();

    //lcd_draw_picture(gImage_800480);
/*
    // 测试写英文字母
    lcd_draw_background(WHITE); 
    draw_ascii_ok(0, 0, RED, "ABCDabcd1234!@#$%");
*/


    // 测试画斜线
    lcd_draw_background(WHITE);         // 如果没有加这一行，背景色是花花绿绿的
    //glib_line(0, 479, 799, 0, RED);
    //draw_circular(399, 239, 50, GREEN);


  
    // 测试画横线、竖线
//    lcd_draw_background(WHITE);
    //lcd_draw_background(BLUE);
	
//    glib_line(0, 479, 799, 0, RED);
  //  draw_circular(399, 239, 50, GREEN);
    lcd_draw_hline(350, 450, 240, RED);
    lcd_draw_vline(400, 190, 290, GREEN);

    draw_ascii_ok(100, 100, BLACK, (char *)"!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG");
    draw_ascii_ok(100, 200, BLACK, (char *)"0 a 1 b 2 c 3 d 4 5 6 7 8 9");
    draw_ascii_ok(100, 300, BLACK, (char *)"abcdefgsAJSDOJFI");

    draw_circular(400, 400, 50, BLACK);
  
// 测试绘制背景色，成功
    while (1);
    {
        lcd_draw_background(RED);
        delay(1000);

        lcd_draw_background(GREEN);
        delay(1000);

        lcd_draw_background(BLUE);
        delay(1000);
    }
    
}
